<template>
  <div class="not-found-page">
    <div class="not-found-container">
      <div class="not-found-content">
        <!-- 错误图标 -->
        <div class="error-icon">
          <ExclamationCircleOutlined />
        </div>
        
        <!-- 错误信息 -->
        <h1 class="error-code">404</h1>
        <h2 class="error-title">{{ $t('error.notFound') }}</h2>
        <p class="error-description">
          {{ $t('error.notFoundDesc') }}
        </p>
        
        <!-- 操作按钮 -->
        <div class="error-actions">
          <a-button type="primary" size="large" @click="goHome">
            <HomeOutlined />
            {{ $t('error.goHome') }}
          </a-button>
          <a-button size="large" @click="goBack">
            <ArrowLeftOutlined />
            {{ $t('error.goBack') }}
          </a-button>
        </div>
        
        <!-- 建议链接 -->
        <div class="suggestions">
          <h3>{{ $t('error.suggestions') || '您可能想要访问：' }}</h3>
          <div class="suggestion-links">
            <a @click="goToProducts">{{ $t('nav.products') }}</a>
            <a @click="goToCategory('手机数码')">{{ $t('category.mobile') || '手机数码' }}</a>
            <a @click="goToCategory('电脑办公')">{{ $t('category.computer') || '电脑办公' }}</a>
            <a @click="goToAbout">{{ $t('nav.about') }}</a>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import {
  ExclamationCircleOutlined,
  HomeOutlined,
  ArrowLeftOutlined
} from '@ant-design/icons-vue'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}

const goToProducts = () => {
  router.push('/products')
}

const goToCategory = (category) => {
  router.push(`/category/${category}`)
}

const goToAbout = () => {
  router.push('/about')
}
</script>

<style scoped>
.not-found-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.not-found-container {
  width: 100%;
  max-width: 600px;
}

.not-found-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 60px 40px;
  text-align: center;
}

.error-icon {
  font-size: 80px;
  color: #ff4d4f;
  margin-bottom: 20px;
}

.error-code {
  font-size: 72px;
  font-weight: bold;
  color: #333;
  margin: 0 0 10px 0;
  line-height: 1;
}

.error-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0 0 15px 0;
}

.error-description {
  font-size: 16px;
  color: #666;
  margin: 0 0 30px 0;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 40px;
}

.error-actions .ant-btn {
  min-width: 120px;
}

.suggestions {
  border-top: 1px solid #f0f0f0;
  padding-top: 30px;
}

.suggestions h3 {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin: 0 0 15px 0;
}

.suggestion-links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.suggestion-links a {
  color: #1890ff;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.suggestion-links a:hover {
  color: #40a9ff;
  border-color: #40a9ff;
  background-color: #f6ffed;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .not-found-content {
    padding: 40px 20px;
  }
  
  .error-code {
    font-size: 48px;
  }
  
  .error-title {
    font-size: 20px;
  }
  
  .error-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .error-actions .ant-btn {
    width: 200px;
  }
  
  .suggestion-links {
    flex-direction: column;
    align-items: center;
  }
  
  .suggestion-links a {
    width: 200px;
    text-align: center;
  }
}
</style> 